<%--
  Created by IntelliJ IDEA.
  User: oldliu
  Date: 2022-02-24
  Time: 15:31
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
  <%
      request.setAttribute("m","<script>alert('王凯宣是个好同志');</script>");
      request.setAttribute("age",112);
      String[]sr={"萝卜","茄子","西红柿","菠萝"};
      request.setAttribute("fruit",sr);
  %>
<%--<h1>${m}</h1>--%>
<h1><c:out value="${m}" /></h1>
  <h1><c:out value="${mss}" default="这个没有"/></h1>

<div>
 <%-- <c:if test="${age>=20}">成年人</c:if>
  <c:if test="${age<20}">未成年</c:if>--%>
<c:choose>
    <c:when test="${age>60}">老头子</c:when>
    <c:when test="${age>45}">中年人</c:when>
    <c:when test="${age>=18}">青年人</c:when>
    <c:otherwise>未成年</c:otherwise>
</c:choose>
</div>
<h2>你喜欢的水果有:</h2>
<c:forEach items="${fruit}" var="f" varStatus="s">
    <p>${s.count}: ${f},是不是最后一个${s.last}</p>
</c:forEach>
</body>
</html>
